Fix three --apply failures found on real Proxmox hosts - #18
Merged
Conversation
- zram-config purge: apt can report "Unable to locate package" even when it's genuinely installed (index doesn't cover it, e.g. Debian trixie without the repo that provided it). Fall back to dpkg --purge, and don't abort the whole run if package cleanup fails — the swap state change is what actually matters. - zswap runtime enable: writing zpool=zsmalloc got "Permission denied" as root on two Proxmox hosts, consistent with kernel lockdown (Secure Boot) blocking the sysfs write's implicit request_module(). Now modprobe zsmalloc explicitly first, and treat runtime-enable failure as non-fatal (the kernel cmdline is still persisted, so zswap comes up correctly after a reboot either way). - Revert hint printed $0, which is just "bash" when run via `curl | sudo bash -s -- --apply` — not something you can rerun. Detect that case and print a working curl-and-pipe one-liner instead. frodo's first --apply run aborted mid-migration on the apt purge bug (zram swapoff'd and service disabled, but zswap never got enabled). Re-running the fixed script picks up cleanly from there since state detection is based on live swapon/sysfs state, not a resume marker.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three bugs surfaced by running
curl | sudo bash -s -- --applyagainst real hosts (frodo, samwise, pbs — all Debian 13 trixie / Proxmox):apt purge -y zram-config→ "Unable to locate package" (frodo). Happened even though zram was genuinely active — apt's package index doesn't cover the package on this system (not every distro carrieszram-configin its default repos). This aborted the whole run underset -e, mid-migration: zram was already swapped off and the service disabled, but zswap was never enabled. Fixed by falling back todpkg --purge, and no longer treating purge failure as fatal — package cleanup isn't load-bearing for the actual swap-behavior change.zpool=zsmalloc→ "Permission denied" as root (samwise, pbs). Consistent with kernel lockdown (Secure Boot) blocking the sysfs write's implicitrequest_module(). Fixed by explicitlymodprobe zsmallocfirst, and making runtime-enable failures non-fatal — the kernel cmdline still gets persisted either way, so zswap comes up correctly after a reboot even if it couldn't go live immediately.sudo $0 --revert --apply, which issudo bash --revert --applywhen run viacurl | sudo bash -s --— not runnable. Now detects the piped case and prints a workingcurl | sudo bash -s -- --revert --applyone-liner instead.Test plan
bash -nsyntax check passes